package com.zmn.oms.third.tmall.dto;

import com.zmn.oms.common.constant.OrderDutyConsts;

/**
 * 天猫勤鸽渠道预约失败原因定义
 *
 * @author xiewenbing
 * @date 2021/07/14
 */
public enum TmallOrderReserveFailReasonEnum {

    RESERVE_FAIL_REASON_ONE(0L, "客户无法确认服务时间"),
    RESERVE_FAIL_REASON_TWO(1L, "电话无人接听"),
    RESERVE_FAIL_REASON_THREE(2L, "未到货"),
    RESERVE_FAIL_REASON_FOUR(3L, "装修周期未到"),
    RESERVE_FAIL_REASON_FIVE(4L, "电话关机/无法接通"),
    RESERVE_FAIL_REASON_SIX(5L, "用户电话有误（提示电话错/空号/停机)"),
    RESERVE_FAIL_REASON_SEVEN(6L, "用户电话有误（提示电话错/空号/停机)");

    /**
     * 预约失败的原因码
     */
    private Long code;

    /**
     * 预约失败的原因描述
     */
    private String desc;

    /**
     * 通过系统的预约失败码查询对应的渠道预约失败信息
     * @param reasonCode
     * @return
     */
    public static TmallOrderReserveFailReasonEnum getByZmnDutyFailCode(Integer reasonCode) {
        switch (reasonCode) {
            case OrderDutyConsts.DUTY_FAIL_CODE_ONE:
                return RESERVE_FAIL_REASON_ONE;
            case OrderDutyConsts.DUTY_FAIL_CODE_TWO:
                return RESERVE_FAIL_REASON_TWO;
            case OrderDutyConsts.DUTY_FAIL_CODE_THREE:
                return RESERVE_FAIL_REASON_THREE;
            case OrderDutyConsts.DUTY_FAIL_CODE_FOUR:
                return RESERVE_FAIL_REASON_FOUR;
            case OrderDutyConsts.DUTY_FAIL_CODE_FIVE:
                return RESERVE_FAIL_REASON_FIVE;
            case OrderDutyConsts.DUTY_FAIL_CODE_SIX:
                return RESERVE_FAIL_REASON_SIX;
            case OrderDutyConsts.DUTY_FAIL_CODE_SEVEN:
                return RESERVE_FAIL_REASON_SEVEN;
            default:
                return RESERVE_FAIL_REASON_ONE;
        }
    }

    TmallOrderReserveFailReasonEnum(Long code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Long getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
